#include <reg51.h>
#include <intrins.h>
void delay();
void main()
{
	unsigned char i,port;
	while (1)
	{
		port = 0xFF;
		P1 = port;
		for (i = 0; i < 8; i++)
		{
			delay();
			port = port << 1;
			P1 = port;
		}
		delay();
	}
	
	 return;
}
//延时函数
void delay()
{
	unsigned char i, j ,k;
	for (i = 0; i < 255; i++)
	{
		for (j = 0; j < 255; j++)
		{
			for ( k = 0; k < 3; k++)
			{
				_nop_();
			}
			
		}
		
	}
	
}
	 
	